//
//  GcInfoCell.m
//  MoXiProject
//
//  Created by 周筱雯 on 2017/6/29.
//  Copyright © 2017年 周筱雯. All rights reserved.
//

#import "GcInfoCell.h"
#import "BuyLotteryModel.h"


@interface GcInfoCell ()
@property (weak, nonatomic) IBOutlet UILabel *gcqihao;
@property (weak, nonatomic) IBOutlet UILabel *gcdate;
@property (weak, nonatomic) IBOutlet UILabel *gcprice;
@property (weak, nonatomic) IBOutlet UILabel *gczhushu;
@property (weak, nonatomic) IBOutlet UILabel *gctype;


@property (nonatomic,strong) UILabel * annNumer;
@end

@implementation GcInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
}
-(void) setgcinfoBuyLotteryDataSource:(BuyLotteryModel *) buyModel{
    
    [self.gcqihao setText:[NSString stringWithFormat:@"第%@期",buyModel.lotteryqihao]];
    [self.gcdate setText:[MXUtility getTimeWithTimestamp:buyModel.lotterycreateTime WithDateFormat:@"yyyy-MM-dd"]];
    [self.gcprice setText:[NSString stringWithFormat:@"%@/%@",buyModel.lotteryorderPrice,buyModel.lotterytotalAmt]];
    [self.gczhushu setText:[NSString stringWithFormat:@"%@注",buyModel.lotterylotteryBets]];
    [self.gctype setText:buyModel.lotterylotteryTypeName];
    
    
    NSString *string = buyModel.lotterylotteryNo;
    NSArray *aArray = [string componentsSeparatedByString:@","];
    for (int i=0; i<aArray.count; i++) {
        self.annNumer = [[UILabel alloc]initWithFrame:CGRectMake(15+35*i, 38, 25, 25)];
        [self.annNumer setTextAlignment:NSTextAlignmentCenter];
        self.annNumer.textColor = DEF_COLOR_MAINCOLOR;
        self.annNumer.text = [NSString stringWithFormat:@"%d",[aArray[i] intValue]];
        self.annNumer.layer.cornerRadius = self.annNumer.width / 2;
        self.annNumer.layer.masksToBounds =  YES;
        self.annNumer.layer.borderColor = DEF_COLOR_MAINCOLOR.CGColor;
        self.annNumer.layer.borderWidth = 1.f;
        [self addSubview:self.annNumer];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
